package com.wenx.v3system.modular.cloud.domain.dto;

import com.wenx.base.domain.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.util.List;

/**
 * 系统部门DTO
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "系统部门信息")
public class SysDepartmentDto extends BaseDto {

    @Schema(description = "父部门ID", example = "2000")
    private Long parentId;

    @Schema(description = "祖级列表（用逗号分隔）", example = "0,2000")
    private String ancestors;

    @NotBlank(message = "部门名称不能为空")
    @Size(max = 100, message = "部门名称长度不能超过100个字符")
    @Schema(description = "部门名称", example = "技术部")
    private String name;

    @NotBlank(message = "部门编码不能为空")
    @Size(max = 50, message = "部门编码长度不能超过50个字符")
    @Schema(description = "部门编码", example = "TECH_DEPT")
    private String code;

    @Size(max = 500, message = "部门描述长度不能超过500个字符")
    @Schema(description = "部门描述", example = "负责技术研发工作")
    private String description;

    @Schema(description = "部门负责人用户ID", example = "3001")
    private Long managerId;

    @Schema(description = "排序", example = "1")
    private Integer sort;

    @Schema(description = "部门状态：1-启用，0-禁用", example = "1")
    private Integer status;

    // 关联关系
    @Schema(description = "部门用户列表")
    private List<SysUserDto> users;

    @Schema(description = "部门团队列表")
    private List<SysTeamDto> teams;

    @Schema(description = "父部门信息")
    private SysDepartmentDto parent;

    @Schema(description = "子部门列表")
    private List<SysDepartmentDto> children;

    @Schema(description = "部门负责人信息")
    private SysUserDto manager;
}